package com.qust.enDecrpytion.annotations;

import com.qust.enDecrpytion.proxy.status.AbstractTypeHandle;
import com.qust.enDecrpytion.proxy.status.PoJoTypeHandle;
import com.qust.enDecrpytion.proxy.status.StringTypeHandle;
import com.qust.encryptionAndDecryption.IEnDecryption;

import java.lang.annotation.*;

@Documented
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface EnDecryptionConfiguration {
    Class<? extends AbstractTypeHandle>[] customHandlers() default {StringTypeHandle.class, PoJoTypeHandle.class};

    Local[] local() default {};

    Remote[] remote() default {};

    @Documented
    @Target({})
    @Retention(RetentionPolicy.RUNTIME)
    @interface Local {
        Class<? extends IEnDecryption> enDecryption();

        String keyPath();

        String password();
    }

    @Documented
    @Target({})
    @Retention(RetentionPolicy.RUNTIME)
    @interface Remote {
        String managerAddress() default "localhost:8086"; // 管理节点的地址
        int algorithmCode(); // 算法编号
    }
}
